<!--
 * @Author: your name
 * @Date: 2021-09-23 22:28:19
 * @LastEditTime: 2021-09-25 11:50:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup-ej-app\src\views\Order\detils.vue
-->
<template>
  <div class="article">
    <van-nav-bar
      title="疫情资讯"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <div class="articleWarp">
      <div class="newHeader">
        <div class="title">{{ articleInf.title }}</div>
        <div class="authorInf">
          <div class="userFace"></div>
          <div class="category">
            <div class="categoryType">栏目分类 | {{ articleInf.category.name }}</div>
            <div class="publishTime">
              发布时间 {{ articleInf.publishTime | dateFormat }}
            </div>
          </div>
        </div>
      </div>
      <div class="newContent" v-html="articleInf.content"></div>
    </div>
    <div style="height:50px"></div>
  </div>
</template>

<script>
import { get } from "@/http/axios";
export default {
  data() {
    return {
      articleInf: {},
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    async getArticleById() {
      let res = await get("/article/findById", { id: this.$route.query.id });
      console.log(res);
      this.articleInf = res.data.data;
    },
  },
  created() {
    this.getArticleById();
  },
};
</script>

<style scoped>
.articleWarp {
}
.newHeader {
  height: 100%;
  background-color: #f8f8f9;
  padding: 10px 20px;
}
.articleWarp .title {
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  margin-bottom: 10px;
  /* width: 50%; */
}
.authorInf .userFace {
  height: 50px;
  width: 50px;
  background-color: red;
  border-radius: 25px;
  display: inline-block;
}
.authorInf {
  margin: 0 auto;
}

.authorInf .category {
  margin-left: 15px;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #999;
  display: inline-block;
}
.authorInf .category .categoryType {
  margin-bottom: 10px;
}
.authorInf .category div {
  flex: 1;
}
.newContent {
  text-align: center;
  width: 90%;
  overflow: hidden;
  margin-top: 10px;
  padding: 10px 20px;
}
</style>